package day06.Lx;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class Lian05 {
    public static void main(String[] args) {
        Date d=new Date();
        SimpleDateFormat time1 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String format = time1.format(d);
        System.out.println("jdk8之前"+format);

        System.out.println("--------");

        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        String format1 = now.format(dtf);
        System.out.println("jdk8之后"+format1);
    }
}
